<?php 
    require_once "../includes/SA/SApersonne.php";
require_once "../includes/SC/SCanimal.php";
require_once "../includes/SC/SCregion.php";
require_once "../includes/SC/SCpays.php";
require_once "../includes/SC/SCplainte.php";
require_once "../includes/SC/SCrapport.php";
require_once "../includes/SC/SCpersonnecontact.php";
require_once "../includes/SC/SCcontrat.php";
require_once "../includes/SC/SCpension.php";
require_once "../includes/SC/SCadoptionprovisoire.php";
require_once "../includes/SC/SCcessionpropriete.php";
require_once "../includes/SC/SCplacement.php";
require_once "../includes/SC/SCrestitution.php";
require_once "../includes/SC/SCtypederace.php";

require_once "../includes/SA/SApersonne.php";
require_once "../includes/SA/SAanimal.php";

?>

<html class="no-js" lang="en">
    <head>
        <meta charset="utf-8" />
        <script type="text/javascript">
            function showRaces(str)
            {
                if (str=="")
                {
                    document.getElementById("txtHint").innerHTML="";
                    return;
                }
                if (window.XMLHttpRequest)
                {// code for IE7+, Firefox, Chrome, Opera, Safari
                    xmlhttp=new XMLHttpRequest();
                }
                else
                {// code for IE6, IE5
                    xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
                }
                xmlhttp.onreadystatechange=function()
                {
                    if (xmlhttp.readyState==4 && xmlhttp.status==200)
                    {
                        document.getElementById("txtHint").innerHTML=xmlhttp.responseText;
                    }
                }
                xmlhttp.open("GET","getRaces.php?q="+str,true);
                xmlhttp.send();
            }
        </script>
    </head>
    <body>

        <form>
            <label for="nom"><b>Nom</b></label>
            <input type="text" name="nom" value="" />
            <br />
            <label for="TypeDeRace"><b>Type</b></label>
            <?php 
                
                    $SCt = new SCtypederace();
                        
                    $listeTypes = $SCt->lister(null);

                    echo '<select name="TypeDeRace" onchange="showRaces(this.value)">';
                    foreach ($listeTypes as $unType) {
                        echo "<option value=".$unType->getNom().">".$unType->getNom()."</option>";
                        //echo "<label><input type='checkbox' name='race value=".$unType->getNom()." />".$unType->getNom()."</label><br />";
                    }
                    echo '</select>';
            ?>
            <br />
            <b>Race</b>
            <div id="txtHint">Sélectionnez un type d'animal.</div>
        </form>
        <br />
        
        
   

    </body>
</html> 